#include "comm.h"
#include "IModel.h"
#include <Kernel.h>

using namespace std;

 void modeltest()
{
	cout << "sampler model plugin : modeltest ..." << endl; 
}

class SamplerModel : public IModel
{
public:
    __declspec(dllexport) virtual ~SamplerModel() {}

    __declspec(dllexport)  SamplerModel()
	{
		;
	}

	__declspec(dllexport) virtual void config(asIScriptEngine *engine)
	{
		int r;
		r = engine->RegisterGlobalFunction("void modeltest()",asFUNCTION(modeltest),asCALL_CDECL); assert(r >= 0);
	}
    /// Get name of the graphics driver
    __declspec(dllexport) virtual const std::string &getName() const {
      static string sName("Sampler Model Plugin");
      return sName;

    }
};

/// Retrieve the engine version we're going to expect
extern "C" __declspec(dllexport) int getVersion() {
  return 1;
}

/// Tells us to register our functionality to an engine kernel
extern "C" __declspec(dllexport) void registerPlugin(Kernel &K) {
  K.getModelManager().addModel(
    auto_ptr<IModel>(new SamplerModel())
  );
}